<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/include/taglibs.jsp"%>

<script type="text/javascript">
//입금확인
function sendSave(){
	if($("input[name='rm_nos']:checked").length==0){
		alert("체크해주세요");
		return false;
	}
	if(confirm("입금처리하시겠습니까?")){
		$("#frmData").submit();
	}
}

//예약취소
function reservationCancel(){
	if($("input[name='rm_nos']:checked").length==0){
		alert("체크해주세요");
		return false;
	}
	if(confirm("취소처리하시겠습니까?")){
		$("#frmData").attr("action","./pere706_3T.do");
		$("#frmData").submit();
	}
}
</script>

<%@ include file="/WEB-INF/jsp/usr/pe/re/pere_top_new7.jsp"%>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
	<tr align="center">
		<td bgcolor="#edecec"><table width="100%" border="0"
				cellspacing="1" cellpadding="0">
				<tr>
					<td height="33" align="center" bgcolor="#fafc98"><table
							width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="20%"><table border="0" cellspacing="0"
										cellpadding="0">
										<tr>
											<td width="30" align="center"><input type="checkbox"
												name="ck_all" id="ck_all"
												onclick="select_all_rsv(this.checked)"></td>
											<td>사용</td>
										</tr>
									</table></td>
								<td width="60%" align="center"><table border="0"
										cellspacing="0" cellpadding="0">
										<tr>
											<td width="75" class="pld">
											
												<c:if test="${'C'==param.rm_status }">예약완료</c:if>
												<c:if test="${'C'!=param.rm_status }">입금대기자</c:if>
											</td>
											<td width="50"><strong>현황: 총</strong></td>
											<td width="35" class="pld">
<%-- 												<c:if test="${'C'==param.rm_status }">${mapCnts.cnt2 }</c:if> --%>
<%-- 												<c:if test="${'C'!=param.rm_status }">${mapCnts.cnt1 }</c:if> --%>
												${fn:length(list) }
											명</td>
											<td><strong>
												<c:if test="${'C'==param.rm_status }">예약완료</c:if><c:if test="${'C'!=param.rm_status }">입금대기자</c:if>가 있습니다</strong></td>
										</tr>
									</table></td>
								<td width="20%">&nbsp;</td>
							</tr>
						</table></td>
				</tr>
			</table>
			<form action="./pere700T.do" id="frmData" method="post">
			<input name="p_id" value="${param.p_id }" type="hidden"/>
			<input name="rm_status" value="${param.rm_status }" type="hidden"/>
			<table width="100%" border="1" cellpadding="0" cellspacing="0"
				bordercolor="#edecec" style="border-collapse: collapse;"
				bgcolor="#FEFEF6">
				<tr align="center" class="greenb2">
					<td width="30">선택</td>
					<td>예약자/휴대폰번호</td>
					<td>객실명</td>
					<td><table border="0" cellspacing="0" cellpadding="1">
							<tr>
								<td>이용일자(예약일자)</td>
							</tr>
						</table></td>
					<td>이용기간</td>
					<td>기준/예약</td>
					<td>요금</td>
					<td>예약상태</td>
					<td class="paddtop4">부가서비스<br> 신청 여부
					</td>
				</tr>
	<c:if test="${list !=null && fn:length(list)>0 }">
		<c:forEach var="map1" items="${list}" varStatus="status">
				<tr align="center">
					<td><input type="checkbox" name="rm_nos"
						value="${map1.rm_no }">
						<c:set var="detailUrl" value="./pere705Q.do?rm_no=${map1.rm_no}&p_id=${param.p_id }"/>
						<c:if test="${'C'==param.rm_status }">
							<c:set var="detailUrl" value="./pere706Q.do?rm_no=${map1.rm_no}&p_id=${param.p_id }"/>
						</c:if>
					</td>
					<td class="paddtop4"><table width="90" border="0"
							cellpadding="0" cellspacing="0" style="cursor: hand;"
							onClick="location.href='${detailUrl}'">
							<tr>
								<td class="ptradgrn">${map1.reservation_nm }
									<c:if test="${'A'==map1.add_type }">
										<span class="ptrend">[관리자]</span>
									</c:if>
								</td>
							</tr>
							<tr>
								<td align="center" class="ptradgrn">${map1.r_phone1 }-${map1.r_phone2 }-${map1.r_phone3 }</td>
							</tr>
						</table></td>
					<td><table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td class="ptradgrn">${map1.room_nm }</td>
							</tr>
						</table></td>
					<td><table border="0" cellpadding="1" cellspacing="0">
							<tr>
								<td class="ptradgrn">${map1.reservation_dt }</td>
							</tr>
						</table></td>
					<td><table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td class="ptradgrn">${map1.day_cnt }</td>
							</tr>
						</table></td>
					<td><table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td class="ptradgrn">${map1.use_man_cnt }</td>
							</tr>
						</table></td>
					<td><table border="0" cellpadding="0" cellspacing="0"
							class="ptradgrn">
							<tr>
								<td><fmt:formatNumber value="${map1.total_pay }" pattern="#,###"/></td>
							</tr>
						</table></td>
					<td><table border="0" cellpadding="0" cellspacing="0">
							<c:if test="${'C'==param.rm_status }">
							<tr>
								<td align="center" class="ptrstandby">예약완료</td>
							</tr>
							</c:if>
							<c:if test="${'C'!=param.rm_status }">
							<tr>
								<td align="center" class="ptrstandby">입금대기</td>
							</tr>
							<tr>
								<td align="center" class="red">${map1.w_time }</td>
							</tr>
							</c:if>
						</table></td>
					<td><table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td>
									<c:if test="${map1.add_svc==0 }">NO</c:if>
									<c:if test="${map1.add_svc!=0 }">YES</c:if>
								</td>
							</tr>
						</table></td>
				</tr>
			
		</c:forEach>
	</c:if>


			</table>
			</form>

			</td>
	</tr>
</table>
<!-- content 종료 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<td align="center">
<c:if test="${'C'!=param.rm_status }">
						<table width="100" border="0" cellspacing="0" cellpadding="2">
							<tr>
								<td>

									<a href="#" onclick="reservationCancel();">
										<img src="/usr/images/res_btn_cancel.gif" width="114" height="36"/>
									</a>
								</td>
								<td>
									<a href="#" onclick="sendSave();">
										<img src="/usr/images/res_btn_deposit.gif" width="114" height="36"/>
									</a>
								</td>
							</tr>
						</table>
</c:if>
					</td>
				</tr>
				<tr>
					<td align="center">&nbsp;</td>
				</tr>
			</table>
	
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td style="padding-bottom: 7px; padding-top: 7px;">※ 예약되지 않은 객실에 마우스를 올리면 <span class="bold">당일요금</span> 이 표시 됩니다<br>
            ※ 예약된 객실에 마우스를 올리면 <span class="bold">예약자</span>와 <span class="bold">전화번호</span> 뒷자리가 표시됩니다</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td height="3" bgcolor="#86ad29"></td>
        </tr>
        <tr>
          <td style="padding-top: 2px;"><%@ include file="/WEB-INF/jsp/usr/pe/re/footer.jsp"%></td>
        </tr>
      </table></td>
  </tr>
</table>